import nci60.data.connected.LeadingProtein


def allGenesInIPI = [:]
LeadingProtein.executeQuery('select g.name, c.chromosome from GeneName g, ProteinChromosome c where g.protein=c.sourceIPI').each{line->
    if(!allGenesInIPI.containsKey(line[1])){allGenesInIPI.put(line[1], [:])}
    allGenesInIPI[line[1]].put(line[0], 0)
}

def foundGenesInIPI = [:]
LeadingProtein.executeQuery('select g.name, c.chromosome from GeneName g, ProteinChromosome c, LeadingProtein l where g.protein=c.sourceIPI and l.protein=g.protein').each{line->
    if(!foundGenesInIPI.containsKey(line[1])){foundGenesInIPI.put(line[1], [:])}
    foundGenesInIPI[line[1]].put(line[0], 0)
}


println 'Chromosome\tNumber of genes (total)\tNumber of genes (identified)'
foundGenesInIPI.sort{it.key}.keySet().each{chrom->
    println ''+chrom+'\t'+allGenesInIPI[chrom].size()+'\t'+foundGenesInIPI[chrom].size()
}